<?php
/**
* @package Pages-and-Items (com_pi_pages_and_items)
* @version 1.5.7
* @copyright Copyright (C) 2006-2010 Carsten Engel. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @author http://www.pages-and-items.com
*/

//no direct access
if(!defined('_VALID_MOS') && !defined('_JEXEC')){
	die('Restricted access');
}


if($class_pi->user_type!='Super Administrator'){
	echo "<script> alert('you need to be logged in as a super administrator to edit the Pages-and-Items config.'); window.history.go(-1); </script>";
	exit();
}

?>
<script src="../includes/js/overlib_mini.js" language="JavaScript" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="components/com_pi_pages_and_items/css/pages_and_items3.css" />
<script language="JavaScript" type="text/javascript">

function submitbutton(pressbutton) {
	if (pressbutton == 'config_itemtype_save') {
		submitform('config_itemtype_save');
	}
	if (pressbutton == 'config_itemtype_apply') {
		document.getElementById('sub_task').value = 'apply';
		submitform('config_itemtype_save');
	}		
	if (pressbutton == 'cancel') {
		document.location.href = 'index2.php?option=com_pi_pages_and_items&task=config';		
	}
}

</script>
<?php

//give headers in Joomla 1.5 a bit more spunk
$class_pi->spunk_up_headers_1_5();

?>
<form name="adminForm" method="post" action="">
	<input type="hidden" name="option" value="com_pi_pages_and_items" />
	<input type="hidden" name="task" value="config_itemtype_save" />	
	<input type="hidden" name="sub_task" id="sub_task" value="" />
	<input type="hidden" name="item_type" value="<?php echo $item_type; ?>" />
	
	<div style="margin: 0 auto; width: 700px; text-align: left;">	
		<a href="index2.php?option=com_pi_pages_and_items">pages and items</a> > <a href="index2.php?option=com_pi_pages_and_items&task=config&tab=itemtypes"><?php echo _pi_lang_config; ?></a> > <?php echo $class_pi->translate_item_type($item_type).' '._pi_lang_config; ?>
		<h2><?php echo $class_pi->translate_item_type($item_type).' '._pi_lang_config; ?></h2>
		<?php 
		
			//include itemtype plugin language					
			$pi_lang_plugin = $class_pi->get_itemtype_language($item_type);			
						
			//get pluginspecific configuration			
			$pi_plugin_config = $class_pi->get_itemtype_config($item_type);
			include(dirname(__FILE__).'/../../../../'.$class_pi->plugin_dir.'/pages_and_items/itemtypes/'.$item_type.'/admin/config.php');				
			
		?>			
	</div>
</form>
<?php $class_pi->display_footer(); ?>